package cn.tedu._03vehicle.pojo.dto;

import io.swagger.v3.oas.annotations.media.Schema;
import jakarta.validation.constraints.*;
import lombok.Data;

@Data
public class UserRegParam {
    //@NotNull(message = "用户名不能为NULL")
    //@NotEmpty(message = "用户名不能为空字符串或NULL")
    //@NotBlank(message = "用户名不能为空字符串或NULL或空白字符串")
    @Pattern(regexp = "^([a-zA-Z]{1,14}|[\\u4e00-\\u9fa5]{1,7})$",message = "用户名不能超过7个汉字或14个英文")
    //@Size(min = 2,max = 10,message = "用户名长度必须在2~10之间")
    @Schema(description = "用户名",required = true)
    private String username;
    @Pattern(regexp = "^(?!.*[\\s\\u4e00-\\u9fa5])((?=.*[a-zA-Z])(?=.*[\\d])|(?=.*[a-zA-Z])(?=.*[\\p{Punct}])|(?=.*[\\d])(?=.*[\\p{Punct}]))[\\w\\p{Punct}]{8,14}$", message = "密码不合法")
    @Schema(description = "密码",required = true)
    private String password;
    @Pattern(
            regexp = "^[a-zA-Z0-9_.-]+@[a-zA-Z0-9-]+(\\.[a-zA-Z0-9-]+)*\\.[a-zA-Z0-9]{2,}$",
            message = "请输入有效的邮箱地址"
    )
    @Schema(description = "邮箱",required = true)
    private String email;
    @Pattern(regexp = "^1[3-9]\\d{9}$",message = "手机号格式错误")
    @Schema(description = "手机号",required = true)
    private String phone;
}
